package com.ophiux.common.data.tenant;

import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestInterceptor;

/**
 * @desc: 租户信息拦截
 * @author: hhl
 * @date：2023/11/22 22:27
 */
@Configuration
public class OphiuxTenantConfiguration {

	/**
	 * openFeign请求头headers传递租户Id
	 * @return
	 */
	@Bean
	public RequestInterceptor ophiuxFeignTenantInterceptor() {
		return new OphiuxFeignTenantInterceptor();
	}

	/**
	 * RestTemplate 请求头headers的租户ID
	 * @return
	 */
	@Bean
	public ClientHttpRequestInterceptor tenantRequestInterceptor() {
		return new TenantRequestInterceptor();
	}

}
